local faxiang = fk.CreateSkill {
  name = "th_faxiang",
  max_turn_use_time = 1,
}

faxiang:addEffect("active", {
  anim_type = "drawcard",
  prompt = "#th_faxiang",
  card_filter = Util.FalseFunc,
  can_use = function(self, player)
    return player:getHandcardNum() < player.maxHp
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    player:drawCards(player.maxHp - player:getHandcardNum(), faxiang.name)
  end
}, { check_skill_limit = true })
faxiang:addEffect(fk.CardUsing, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill("th_faxiang") and player.room.current == player then
      return target and target ~= player and data.card
    end
  end,
  on_cost = function(self, event, target, player, data)
    local str = "#th_faxiang-nullify:" .. target.id .. "::" .. data.card:toLogString()
    return player.room:askToSkillInvoke(player, {
      skill_name = faxiang.name,
      prompt = str
    })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    data.toCard = nil
    data.tos = {}
  end
}, { check_skill_limit = true })

Fk:loadTranslationTable{
  ["th_faxiang"] = "法相",
  [":th_faxiang"] = "回合内限一次：出牌阶段，你可以将手牌摸至体力上限；其他角色使用牌时，你可以令此牌无效。",

  ["#th_faxiang"] = "法相：将手牌摸至体力上限",

  ["#th_faxiang-nullify"] = "法相：你可以令 %src 的 %arg 无效",
}

return faxiang